package com.group12.liuxinpeng.user.repository;

import com.group12.liuxinpeng.mybatis.entity.PtMenuEntity;
import com.group12.liuxinpeng.mybatis.entity.PtUserEntity;
import com.group12.liuxinpeng.mybatis.flexigrid.PagingBean;
import com.group12.liuxinpeng.mybatis.ztree.ZtreeEntity;
import com.group12.liuxinpeng.user.entity.UserSearchEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {
    PtUserEntity queryUserInfoByUserName(@Param("userName") String userName);

    List<PtMenuEntity> queryMenuInfoByLang(@Param("lang") String lang);

    List<PtUserEntity> queryUserListByPadding(@Param("search")UserSearchEntity search, @Param("paging")PagingBean paging);

    Integer queryUserListTotal(@Param("search")UserSearchEntity search);

    void deleteUserById(@Param("userUuid")String userUuid);

    /**
     * @Description: //TODO 查询角色列表
     * @Author: wyq
     * @Date 2022/5/16 10:11
     */
    List<ZtreeEntity> getRoleZtreeList();

    /**
     * @Description: //TODO 通过用户Uuid查询对应角色的Uuid
     * @Author: wyq
     * @Date 2022/5/16 10:18
     */
    List<String> queryRoleZtreeListByUserId(@Param("userUuid")String userUuid);

    /**
     * @Description: //TODO 插入用户Uuid和对应的角色id
     * @Author: wyq
     * @Date 2022/5/16 10:31
     */
    void insertRoleRefUser(@Param("roleId") String roleId, @Param("userUuid") String userUuid);

    /**
     * @Description: //TODO 通过用户Uuid删除对应分配的角色
     * @Author: wyq
     * @Date 2022/5/16 10:35
     */
    void delRoleByUserId(@Param("userUuid") String userUuid);
}
